import 'package:vista/shared/models/base_frame.dart';

/// 摄影参数画面
/// 存储摄影参数信息，如摄影中的参数设置般记录拍摄细节
class PhotoParams extends BaseFrame {
  final String lens; // 镜头
  final String fl; // 焦距
  final String flash; // 闪光灯
  final String exposure; // 曝光模式
  final String camera; // 相机型号
  final String iso; // ISO感光度
  final String shutter; // 快门速度
  final String aperture; // 光圈

  const PhotoParams({
    required this.lens,
    required this.fl,
    required this.flash,
    required this.exposure,
    required this.camera,
    required this.iso,
    required this.shutter,
    required this.aperture,
  });

  /// 从JSON创建摄影参数画面
  factory PhotoParams.fromJson(Map<String, dynamic> json) {
    return PhotoParams(
      lens: json['lens'] as String? ?? '',
      fl: json['fl'] as String? ?? '',
      flash: json['flash'] as String? ?? '',
      exposure: json['exposure'] as String? ?? '',
      camera: json['camera'] as String? ?? '',
      iso: json['iso'] as String? ?? '',
      shutter: json['shutter'] as String? ?? '',
      aperture: json['aperture'] as String? ?? '',
    );
  }

  @override
  List<Object?> get props => [
    lens,
    fl,
    flash,
    exposure,
    camera,
    iso,
    shutter,
    aperture,
  ];

  @override
  Map<String, dynamic> toJson() {
    return {
      'lens': lens,
      'fl': fl,
      'flash': flash,
      'exposure': exposure,
      'camera': camera,
      'iso': iso,
      'shutter': shutter,
      'aperture': aperture,
    };
  }
}
